package java19_3_22_reflect.rawtype;

/**
 * @author yuisama
 * @date 2022/03/22 20:01
 **/
public class Outter {
    public static void main(String[] args) {
        Outter outter = new Outter();
        outter.fun();
    }
    private int age = 18;
    private static String country = "中国";
    // 外部类
    public void fun() {
        Inner1 inner1 = new Inner1();
        inner1.test();
    }
    // 成员内部类
    public class Inner1 {
        // error
//        static int a = 10;
        public void test() {
            System.out.println(Outter.this.age);
            System.out.println(country);
        }

    }
    // 静态内部类就是套在了Outter内部而已，不依赖Outter对象
    public static class Inner2{
        private int a = 10;
        private static double hehe = 10.1;
        public void fun() {
            System.out.println(country);
            // 不能访问外部类的成员域
            // error
//            System.out.println(age);
        }
    }

}